<?php
    $limit = ($limit_article < count($article)) ? $limit_article : count($article);
    for($count = 0;$count < $limit;$count++) {
    $row = $article[$count];
    $url_title = url_title($row->title);
?>
    <div class="post-wrapper">
        <div class="post-top">
            <div class="post-thumbnail">
                <a>
                    <?php
                    if ($row->image->num_rows() > 0) {
                        $front_image = $row->image->first_row();
                        ?>
                        <img src="<?php echo base_url() . 'img/uploads/thumb/' . $front_image->image_url; ?>"/>
                        <?php
                    }
                    ?>
                </a>
            </div>
            <div class="post-content">
                <div class="post-title">
                    <a href="<?php echo base_url() . 'main/view/' . $row->article_id.'/'.$url_title; ?>">
                        <?php echo $row->title; ?>
                    </a>
                </div>
                <div class="post-snapshot">
                    <?php echo $row->content; ?>
                    <p class="read-more-p">
                        <a class="read-more-a" href="<?php echo base_url() . 'main/view/' . $row->article_id.'/'.$url_title; ?>">
                            Read More
                        </a>
                    </p>
                </div>
            </div>
        </div>
        <div class="post-bottom">
            <div class="post-utility">
                <div class="post-meta">
                    <p>Posted in  <a><?php echo $row->category_name; ?></a> By <?php echo $row->name; ?> At <?php echo $row->post_date; ?></p>
                </div>
            </div>                        
        </div>
    </div>
<?php } ?>